<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Activity extends MY_Controller {
	function __construct(){
		parent::__construct();
		$this->load->model('page_model');
		$this->load->model('article_model');
		$this->load->model('gallery_model');
		$this->load->model('coltypes_model');
	}
	
	//活动。
	public function index(){
		$arr=$this->db->order_by('sort_id','desc')->select('id,title,content,timeline')->where(array('audit'=>1,'cid'=>6))->get('article')->result_array();
		//var_dump($arr);exit;
		if(!empty($arr)){
			foreach($arr as $k=>$v){
					$day[$k]['day']=date('Y-n-j',$v['timeline']);
			}
		}
			$temp=array();
			foreach($day as $v){
				$temp[]=$v['day'];
			}
			$data['news']=array_count_values($temp);
			//foreach($data['news'] as $key=>$value){
				//$data['list']=$this->db->order_by('sort_id','desc')->select('id,title,content,timeline')->where(array('audit'=>1,'cid'=>6,'timeline'=>))->get('article')->result_array();
				//$data['list']=$this->db->query("SELECT * FROM boc_article where cid = 6 AND audit = 1 AND timeline =  order_by('sort_id','desc')))->result_array();
			//}
/// 		var_dump($data['news']);exit;
		$data['seo']=$this->db->get_where('columns',array('id'=>6))->row_array();//获取seo
		$this->load->view('activity',$data);
	}
	
// 	public function info($id=''){
// 		$data['info']=$this->db->get_where('article',array('cid'=>6,'id'=>$id))->row_array();
// 		$data['seo']=$this->db->get_where('article',array('id'=>$id))->row_array();//获取seo
// 		$this->load->view('news_info',$data);
// 	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}